Hi
Lets say you want to make steps out of crates to get somewhere right?
In every mod ive seen you need to add heaps of these
eg
And so on just to make a few stepsCode:local.static = spawn script_model local.static model "static/indycrate.tik" local.static.origin = ( 805 485 -140 ) local.static.angles = ( 0 90 0 ) local.static solid local.static nodamage local.static = spawn script_model local.static model "static/indycrate.tik" local.static.origin = ( 805 485 -92 ) local.static.angles = ( 0 90 0 ) local.static solid local.static nodamage etc etc
Now ive looked through some mods that use array to spawn flaks in different positions to blow up
eg
Now ive tried unsuccessfully to use this method to spawn objects but not make them random and always be there.Code:////------setup random spots for the flak--- local.origins = makeArray ( -432.25 1078.15 23.56 )( 0 175 0 ) ( -1560.30 -127.01 -22.43 )( 0 -95 0 ) ( -1560.30 -127.01 -22.43 )( 0 -95 0 ) ( 560.23 -66.56 -47.20 )( 0 -126 0 ) endArray local.random = randomint(local.origins.size)+1 local.random_coords = local.origins[local.random][1] local.random_angles = local.origins[local.random][2] thread flak local.random_coords local.random_angles flak local.origin local.angles: //local.angles = ( 0 local.angle 0 ) local.x = (angles_toforward local.angles) local.y = (angles_toleft local.angles) * -1 local.z = angles_toup local.angles local.flakbase = spawn script_model local.flakbase model "statweapons/flak88base.tik" local.flakbase.origin = local.origin local.flakbase.angles = local.angles local.flakbase.targetname = "flak88_base1" local.flakcoll1 = spawn script_model local.flakcoll1 model "items/dm_50_healthbox.tik" local.flakcoll1.origin = local.origin local.flakcoll1 setsize ( -100 -26 -50 ) ( 105 26 100 ) local.flakcoll1.angles = local.angles local.flakcoll1 hide local.flakcoll2 = spawn script_model local.flakcoll2 model "items/dm_50_healthbox.tik" local.flakcoll2.origin = (local.origin + (local.x * 50)) local.flakcoll2 setsize ( -15 -75 -50 ) ( 15 75 100 ) local.flakcoll2.angles = local.angles local.flakcoll2 hide local.flak = spawn script_model local.flak model "statweapons/flak88turret.tik" local.flak.origin = (local.origin + (local.z * 48 )) local.flak.angles = local.angles local.flak.targetname = "flak88_weapon1" local.flak.destroyed_model = "models/statweapons/flak88_d.tik" local.bomb = spawn script_model local.bomb model "items/pulse_explosive.tik" local.bomb.origin = (local.origin + (local.x * 7.75) + (local.y * -35.78 ) + (local.z * 64.0)) local.bomb.angles = local.angles local.bomb.targetname = "bomb1" local.bomb.explosion_sound = "grenade_explode" local.bomb.explosion_fx = "fx/fx_flak88_explosion.tik" local.bomb.trigger_name = "flak88_weapon1_trigger" local.bomb.target = "flak88_weapon1" local.trigger = spawn trigger_use local.trigger.targetname = "flak88_weapon1_trigger" local.trigger.origin = (local.origin + (local.x * -3.0) + (local.y * -30.0) + (local.z * 71.0)) local.trigger setsize ( -10 -10 -10 ) ( 10 10 10 ) local.trigger.angles = local.angles end
So you have something like
But it doesnt seem to work, tried changing just little bits of the mod above, but all ive managed to do it turn the flak into a crate with a bomb , but i just want normal crates in an easier format with an array for the coords instead of heaps of the same object in different spotsCode:local.origins = makeArray ( -432.25 1078.15 23.56 )( 0 175 0 ) ( -1560.30 -127.01 -22.43 )( 0 -95 0 ) ( -1560.30 -127.01 -22.43 )( 0 -95 0 ) ( 560.23 -66.56 -47.20 )( 0 -126 0 ) endArray thread crate local.origin local.angles crate local.origin local.angles: //local.angles = ( 0 local.angle 0 ) local.x = (angles_toforward local.angles) local.y = (angles_toleft local.angles) * -1 local.z = angles_toup local.angles local.static = spawn script_model local.static model "static/indycrate.tik" local.static.origin = local.origin local.static.angles = local.angles local.static solid local.static nodamage
I tried to explain it best i could , if it seems abit confusing ill try to explain clearer
So if anyone has something like to to spawn the same object at multiple spots without typing in heaps it would be appreciated



Reply With Quote

